<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件</title>
    <style>
        ul {
            /* width: 800px; */
        }

        li {
            float: left;
            list-style: none;
            background-color: aquamarine;
            width: 200px;
            height: 100px;
            border: 1px solid black;
        }

        .clearfix:after {
            /*伪元素是行内元素 正常浏览器清除浮动方法*/
            content: "";
            display: block;
            height: 0;
            clear: both;
            visibility: hidden;
        }

        .clearfix {
            *zoom: 1;
            /*ie6清除浮动的方式 *号只有IE6-IE7执行，其他浏览器不执行*/
        }
    </style>
</head>

<body>
    <ul class="clearfix">
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ul>
    <button onclick="addLi()">添加节点</button>
</body>
<script src="./js/jquery.min.js"></script>
<script>
    // $('ul').append('<li></li>')
    function addLi() {
        $('ul').append('<li></li>')
    }
    $('ul').click((e)=>{
console.log(e.target);
e.target.backgroundColor='pink'
    })
</script>

</html>